1. Field of the Invention
The present invention relates to a focus detecting apparatus for a camera according to a phase difference system.
2. Description of the Prior Art
A focus detecting apparatus is used for auto-focusing (automatic focusing) of a camera, and various types of the apparatus are conventionally known.
In a single-lens reflex camera, a phase difference system is often used in which two images are focused on an image sensor by a light beam received from an object to be photographed through a photographing lens, and an offset amount between an image interval of the two images and that obtained in an in-focus state is detected, thereby obtaining a defocus amount of the photographing lens.
In this system, portions of the two images having the highest correlation degree are obtained, and the defocus amount is calculated on the basis of the image interval between these portions. That is, correlation calculation is performed such that a difference between image signals of the two images is obtained in units of corresponding pixel outputs while a pixel of the image sensor is shifted one by one and a total sum of the differences is calculated. It is assumed that data calculated in this manner (to be referred to as "comparison data" hereinafter) is minimized at a position at which the two images are completely superposed on each other. Therefore, a position at which the comparison data is minimized has the highest correlation degree. The defocus amount can be obtained in accordance with an amount of shifting of the image pixel (to be referred to as a "shift amount" hereinafter). That is, if a shift amount obtained when the comparison data is minimized is preset to be a shift amount A in an in-focus state, an offset amount between the image intervals is obtained as a difference between the shift amount obtained when the comparison data is minimized and the shift amount A in the in-focus state. Therefore, the defocus amount can be obtained in accordance with the offset amount (Japanese Patent Laid-Open No. 60-243618).
However, according to a method in which only one portion having a high correlation degree is detected, if an object to be photographed is constituted by a repetitive pattern or has a low contrast, erroneous focus detection may be result. In addition, the comparison data is calculated while the pixels are shifted one by one, i.e., the comparison data is obtained not continuously but stepwise. Therefore, if the contrast cf an object to be photographed is low, a portion at which the comparison data is minimized is not always a portion having the highest correlation degree.
For this reason, in a conventional apparatus, focus detection is not always accurately performed when an object to be photographed is as described above.
Meanwhile, in the phase difference system of this type, an offset amount having a smaller value than a pixel pitch of an image sensor cannot be obtained. Therefore, conventionally, a portion having the highest correlation degree is obtained by interpolation calculation, and a defocus amount is calculated on the basis of the calculated portion (Japanese Patent Laid-Open No. 60-243618).
In this conventional interpolation calculation, three smallest comparison data are selected from the comparison data, and a portion having the highest correlation degree is obtained on the basis of the selected comparison data. However, reliabilities obtained when the three data are used for interpolation calculation are different from each other. That is, the smallest comparison data has a highest reliability, and a reliability is degraded as a value of the data is increased. Therefore, these three data cannot be similarly used. For this reason, according to the conventional interpolation method in which the third smallest data is similarly used as the other two data, the reliability of a calculation result is degraded.